<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::poisson::Allocator&lt; T &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1poisson_1_1_allocator.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pri-attribs">Private 属性</a> &#124;
<a href="classpcl_1_1poisson_1_1_allocator-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::poisson::Allocator&lt; T &gt; 模板类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="allocator_8h_source.html">allocator.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a5fb60e6321b4b65c11e8fc208b6ffda9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1poisson_1_1_allocator.html#a5fb60e6321b4b65c11e8fc208b6ffda9">reset</a> (void)</td></tr>
<tr class="separator:a5fb60e6321b4b65c11e8fc208b6ffda9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ab8c615328f98aaccc74e69dd893639"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpcl_1_1poisson_1_1_allocator_state.html">AllocatorState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1poisson_1_1_allocator.html#a0ab8c615328f98aaccc74e69dd893639">getState</a> (void) const</td></tr>
<tr class="separator:a0ab8c615328f98aaccc74e69dd893639"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7232a3a9f3501f73f6cf1bf9ff7aa316"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1poisson_1_1_allocator.html#a7232a3a9f3501f73f6cf1bf9ff7aa316">rollBack</a> (void)</td></tr>
<tr class="separator:a7232a3a9f3501f73f6cf1bf9ff7aa316"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0029ac7164149702cbd0a2c6ccb68b4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1poisson_1_1_allocator.html#ae0029ac7164149702cbd0a2c6ccb68b4">rollBack</a> (const <a class="el" href="classpcl_1_1poisson_1_1_allocator_state.html">AllocatorState</a> &amp;state)</td></tr>
<tr class="separator:ae0029ac7164149702cbd0a2c6ccb68b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f131d31e195009e744ae298d0a495b7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1poisson_1_1_allocator.html#a2f131d31e195009e744ae298d0a495b7">set</a> (int blockSize)</td></tr>
<tr class="separator:a2f131d31e195009e744ae298d0a495b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab51229c4df33243499c3ed9634698ca"><td class="memItemLeft" align="right" valign="top">T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1poisson_1_1_allocator.html#aab51229c4df33243499c3ed9634698ca">newElements</a> (int elements=1)</td></tr>
<tr class="separator:aab51229c4df33243499c3ed9634698ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private 属性</h2></td></tr>
<tr class="memitem:aa40266befe04c312f1da84391be8e410"><td class="memItemLeft" align="right" valign="top"><a id="aa40266befe04c312f1da84391be8e410"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>blockSize</b></td></tr>
<tr class="separator:aa40266befe04c312f1da84391be8e410"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af33c59557fbb69545dc5a19626e86a1b"><td class="memItemLeft" align="right" valign="top"><a id="af33c59557fbb69545dc5a19626e86a1b"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>index</b></td></tr>
<tr class="separator:af33c59557fbb69545dc5a19626e86a1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acda96ba474e8a1d9bd1645326ceb3996"><td class="memItemLeft" align="right" valign="top"><a id="acda96ba474e8a1d9bd1645326ceb3996"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>remains</b></td></tr>
<tr class="separator:acda96ba474e8a1d9bd1645326ceb3996"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e60d61489a6e1c5014936d86c6a34ef"><td class="memItemLeft" align="right" valign="top"><a id="a0e60d61489a6e1c5014936d86c6a34ef"></a>
std::vector&lt; T * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>memory</b></td></tr>
<tr class="separator:a0e60d61489a6e1c5014936d86c6a34ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;class T&gt;<br />
class pcl::poisson::Allocator&lt; T &gt;</h3>

<p>This templated class assists in memory allocation and is well suited for instances when it is known that the sequence of memory allocations is performed in a stack-based manner, so that memory allocated last is released first. It also preallocates memory in chunks so that multiple requests for small chunks of memory do not require separate system calls to the memory manager. The allocator is templated off of the class of objects that we would like it to allocate, ensuring that appropriate constructors and destructors are called as necessary. </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a0ab8c615328f98aaccc74e69dd893639"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ab8c615328f98aaccc74e69dd893639">&#9670;&nbsp;</a></span>getState()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classpcl_1_1poisson_1_1_allocator_state.html">AllocatorState</a> <a class="el" href="classpcl_1_1poisson_1_1_allocator.html">pcl::poisson::Allocator</a>&lt; T &gt;::getState </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This method returns the memory state of the allocator. </p>
<div class="fragment"><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                                           {</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;          AllocatorState s;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;          s.index=index;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;          s.remains=remains;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;          <span class="keywordflow">return</span> s;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="aab51229c4df33243499c3ed9634698ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab51229c4df33243499c3ed9634698ca">&#9670;&nbsp;</a></span>newElements()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T* <a class="el" href="classpcl_1_1poisson_1_1_allocator.html">pcl::poisson::Allocator</a>&lt; T &gt;::newElements </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>elements</em> = <code>1</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This method returns a pointer to an array of elements objects. If there is left over pre-allocated memory, this method simply returns a pointer to the next free piece of memory, otherwise it pre-allocates more memory. Note that if the number of objects requested is larger than the value blockSize with which the allocator was initialized, the request for memory will fail. </p>
<div class="fragment"><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                                       {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;          T* mem;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;          <span class="keywordflow">if</span>(!elements){<span class="keywordflow">return</span> NULL;}</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;          <span class="keywordflow">if</span>(elements&gt;blockSize){</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            fprintf(stderr,<span class="stringliteral">&quot;Allocator Error, elements bigger than block-size: %d&gt;%d\n&quot;</span>,elements,blockSize);</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;          }</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;          <span class="keywordflow">if</span>(remains&lt;elements){</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;            <span class="keywordflow">if</span>(index==memory.size()-1){</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;              mem=<span class="keyword">new</span> T[blockSize];</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;              <span class="keywordflow">if</span>(!mem){fprintf(stderr,<span class="stringliteral">&quot;Failed to allocate memory\n&quot;</span>);exit(0);}</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;              memory.push_back(mem);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;            }</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;            index++;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;            remains=blockSize;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;          }</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;          mem=&amp;(memory[index][blockSize-remains]);</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;          remains-=elements;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;          <span class="keywordflow">return</span> mem;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a5fb60e6321b4b65c11e8fc208b6ffda9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5fb60e6321b4b65c11e8fc208b6ffda9">&#9670;&nbsp;</a></span>reset()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1poisson_1_1_allocator.html">pcl::poisson::Allocator</a>&lt; T &gt;::reset </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This method is the allocators destructor. It frees up any of the memory that it has allocated. </p>
<div class="fragment"><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                        {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;          <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i=0;i&lt;memory.size();i++){<span class="keyword">delete</span>[] memory[i];}</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;          memory.clear();</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;          blockSize=index=remains=0;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae0029ac7164149702cbd0a2c6ccb68b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0029ac7164149702cbd0a2c6ccb68b4">&#9670;&nbsp;</a></span>rollBack() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1poisson_1_1_allocator.html">pcl::poisson::Allocator</a>&lt; T &gt;::rollBack </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1poisson_1_1_allocator_state.html">AllocatorState</a> &amp;&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This method rolls back the allocator to the previous memory state and makes all of the memory previously allocated available for re-allocation. Note that it does it not call the constructor again, so after this method has been called, assumptions about the state of the values in memory are no longer valid. </p>
<div class="fragment"><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                                                  {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;          <span class="keywordflow">if</span>(state.index&lt;index || (state.index==index &amp;&amp; state.remains&lt;remains)){</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            <span class="keywordflow">if</span>(state.index&lt;index){</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;              <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=state.remains;j&lt;blockSize;j++){</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                memory[state.index][j].~T();</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;                <span class="keyword">new</span>(&amp;memory[state.index][j]) T();</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;              }</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;              <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=state.index+1;i&lt;index-1;i++){</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;blockSize;j++){</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                  memory[i][j].~T();</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                  <span class="keyword">new</span>(&amp;memory[i][j]) T();</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;              }</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;              <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;remains;j++){</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                memory[index][j].~T();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                <span class="keyword">new</span>(&amp;memory[index][j]) T();</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;              }</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;              index=state.index;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;              remains=state.remains;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;            }</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            <span class="keywordflow">else</span>{</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;              <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;state.remains;j&lt;remains){</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                memory[index][j].~T();</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                <span class="keyword">new</span>(&amp;memory[index][j]) T();</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;              }</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;              remains=state.remains;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            }</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;          }</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a7232a3a9f3501f73f6cf1bf9ff7aa316"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7232a3a9f3501f73f6cf1bf9ff7aa316">&#9670;&nbsp;</a></span>rollBack() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1poisson_1_1_allocator.html">pcl::poisson::Allocator</a>&lt; T &gt;::rollBack </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This method rolls back the allocator so that it makes all of the memory previously allocated available for re-allocation. Note that it does it not call the constructor again, so after this method has been called, assumptions about the state of the values in memory are no longer valid. </p>
<div class="fragment"><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;                           {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;          <span class="keywordflow">if</span>(memory.size()){</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i=0;i&lt;memory.size();i++){</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;              <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;blockSize;j++){</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                memory[i][j].~T();</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                <span class="keyword">new</span>(&amp;memory[i][j]) T();</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;              }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;            }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            index=0;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            remains=blockSize;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;          }</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a2f131d31e195009e744ae298d0a495b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f131d31e195009e744ae298d0a495b7">&#9670;&nbsp;</a></span>set()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1poisson_1_1_allocator.html">pcl::poisson::Allocator</a>&lt; T &gt;::set </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>blockSize</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This method initiallizes the constructor and the blockSize variable specifies the the number of objects that should be pre-allocated at a time. </p>
<div class="fragment"><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                                {</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;          <a class="code" href="classpcl_1_1poisson_1_1_allocator.html#a5fb60e6321b4b65c11e8fc208b6ffda9">reset</a>();</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;          this-&gt;blockSize=blockSize;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;          index=-1;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;          remains=0;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        }</div>
<div class="ttc" id="aclasspcl_1_1poisson_1_1_allocator_html_a5fb60e6321b4b65c11e8fc208b6ffda9"><div class="ttname"><a href="classpcl_1_1poisson_1_1_allocator.html#a5fb60e6321b4b65c11e8fc208b6ffda9">pcl::poisson::Allocator::reset</a></div><div class="ttdeci">void reset(void)</div><div class="ttdef"><b>Definition:</b> allocator.h:64</div></div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>surface/include/pcl/surface/3rdparty/poisson4/<a class="el" href="allocator_8h_source.html">allocator.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><b>poisson</b></li><li class="navelem"><a class="el" href="classpcl_1_1poisson_1_1_allocator.html">Allocator</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
